/*
 * @Author: hongbin
 * @Date: 2022-12-05 13:54:22
 * @LastEditors: hongbin
 * @LastEditTime: 2022-12-20 22:31:53
 * @Description:添加模型信息
 */
import type { NextApiRequest, NextApiResponse } from "next";
import DB from "../mongodb";
import { AllowCORS } from "../utils";

export default async function handler(req: NextApiRequest, res: NextApiResponse) {
    const db = await DB;
    AllowCORS(req, res);
    const list = await db.collection("models").find({ isUse: true }).toArray();
    console.log(list);
    res.json(list);
}
